import java.util.Arrays;
import java.time.*;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-03-18
 * Time: 8:43
 */
public class TestDemo {
    public class EmployeeTest {
        public static void main(String口 args)
        {
           // fill the staff array with three Employee objects
          Employee[] staff = new Employee[3];

            staff[0] = new Employee("Carl Cracker", 75000, 1987, 12, 15);
            staff[1] = new Employee("Harry Hacker", 50000, 1989, 10, 1);
           staff[2] = new Employee("Tony Tester", 40000, 1990, 3, 15);

             // raise everyone's salary by 5%
             for (Employee e : staff)
             e.raiseSalary(5);
             // print out information about all Employee objects
             for (Employee e : staff)
            System.out.println("name=" + e. getNameO + ",salary=" + e.getSalaryO + ", hi reDay="
                + e.getHireDay);
             }
         }
         class Employee {
         private String name;
        private double salary;
        private LocalDate hireDay;

         public Employee(String n , double s, int year, int month , int day)
         {
             name = n;
             salary = s;
             hireDay = LocalDate.of(year , month, day);
             }

         public String getName{
             return name;
         }

         public double getSalary{
                 return salary;
             }
            public LocalDate getHireDay{
                 return hireDay;
            }
                 public void raiseSalary(double byPercent){
                 double raise = salary * byPercent / 100;
                 salary += raise;
                 }
            }
}
// import java.util.*;


// public class Solution {
//     public int maxLength (int[] arr) {
//         // write code here
//         Arrays.sort(arr);//先给数组排好序
//         int pa = 1;
//         int count =1;
//         while(pa<=arr.length-1) {
//             int tmp = arr[pa];
//             if(arr[pa-1]==arr[pa]) {
//                 pa++;
//             }else {
//                 count++;
//                 pa++;
//             }
//         }
//         return count;
//     }
// }
//import java.util.*;
//
//
//public class Solution {
//    /**
//     *
//     * @param arr int整型一维数组 the array
//     * @return int整型
//     */
//    public int maxLength (int[] arr) {
//        int result = 0,start = 0;//result为之后结果，start为起点下标
//        int[] end = new int[100000];//记录数组中数据的下标
//        for(int i = 0; i < arr.length; i++) {
//            int num=arr[i];
//            if(start<end[num]){//如果该值的在end中存，则把起点设为相同值的下一个值的下标
//                start=end[num];
//            }
//            if(result<i-start+1){//因为start为i+1,所以-start时要+1
//                result=i-start+1;
//            }
//            end[num] = i+1;
//        }
//        return result;
//    }
//}








